<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>响应式布局</title>
    <style>
        /* .html{
            font-size: 20px;
        } */
        .box1{
            height: 300px;
            width: 300px;
            background-color: aquamarine;
        }
        .box2{
            width: 5rem;
            height: 3rem;
            background-color: aqua;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <script>
        function resethtmlsize() {
            console.log(document.documentElement)
            document.documentElement.style.fontSize=screen.width/10+'px'
        }
        window.onresize = resethtmlsize
    </script>
</body>
</html>